Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve local ijk's of an LGR, given its name #828

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

aritorto
Copy link
Member

@aritorto aritorto commented Jan 30, 2025

To facilitate output file generation, it is beneficial to retrieve the local IJK coordinates from each refined level grid based on its name.

Currently, inactive cells in LGRs are not supported in "opm-common." Nevertheless, an lgrIJK() test for a grid containing inactive cells within the LGR block has been added (and commented out). This case test passes if initLgr() is not invoked in opm-common/opm/input/eclipse/EclipseState/EclipseState.cpp.

@aritorto
Copy link
Member Author

jenkins build this please

@aritorto aritorto force-pushed the elemIdxToLocalIJK branch 2 times, most recently from 1a44eec to 482e329 Compare January 30, 2025 10:49

for (const auto& element : elements(levelGridView(level))) {
std::array<int, 3> local_ijk;
levelCartMapp.cartesianCoordinate(element.getEquivLevelElem().index(), local_ijk, element.level());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks a bit to complicated. element should be on the level and should be passed directly.

Why do we need to specify the last parameter? Shouldn't the level should be implied by the element.

Copy link
Member Author

@aritorto aritorto Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, it's enough with element.index(). The last parameter we need since the LevelCartesianIndexMapper takes a CpGrid in it's constructor, instead of a CpGridaData. Then, you should specify the level.

I'll check any improvements on LevelCartesianIndexMapper to avoid this last argument.

@@ -713,6 +714,30 @@ std::vector<std::array<int,2>> CpGrid::mapLeafIndexSetToLocalCartesianIndexSets(
return leafIdx_to_localCartesianIdxSets;
}

std::vector<std::array<int,3>> CpGrid::localIJK(const std::string& lgr_name) const
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this a free function instead of a member function?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should. Then lgr_names_ could be replace by a call of getLgrNameToLevel()

@aritorto
Copy link
Member Author

aritorto commented Jan 30, 2025

@blattms At some point, some methods related to refinement can be moved into CpGridUtilities, in case the header is kept

@aritorto
Copy link
Member Author

jenkins build this please

1 similar comment
@aritorto
Copy link
Member Author

jenkins build this please

@aritorto
Copy link
Member Author

jenkins build this please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants